﻿/*
 *********************************************************************
 *    Management Extensions for Windows Windows Server AppFabric     *
 *********************************************************************
 *    Author    : Fatih Boy [fatih@enterprisecoding.com]             *
 *    Web site  : http://www.enterprisecoding.com                    *
 *********************************************************************
 *    License   : GNU Library General Public License (LGPL)          * 
 *********************************************************************
 */

using Microsoft.Web.Management.Server;
using System;

namespace Com.Enterprisecoding.AppFabric.Extensions.Client {
    internal abstract class ResultObjectWrapper {
        public PropertyBag PropertyBag { get; private set; }

        public static ResultObject CreateInstace<ResultObject>(PropertyBag propertyBag) where ResultObject : ResultObjectWrapper, new() {
            if (propertyBag == null) { return default(ResultObject); }

            var instance = Activator.CreateInstance<ResultObject>();
            instance.PropertyBag = propertyBag;

            return instance;
        }
    }
}